﻿using Quartz;
using System;
using System.Data;
using System.Data.Common;
using MyCode.Project.Services;
using MyCode.Project.Infrastructure;
using MyCode.Project.Infrastructure.UnityExtensions;
using Microsoft.Practices.Unity;
using System.Reflection;
using MyCode.Project.Domain.Model;
using System.Collections;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Threading;

namespace MyCode.Project.ScheduleTask.Jobs
{
	public class MorningTimeJob : IJob
    {

		private readonly IStorageService _storageService;
        private ILiveVideoService _liveVideoService;
        private IMemberInfoService _memberInfoService;
        private ISalesSheetService _salesSheetService;

        public MorningTimeJob(IStorageService storageService
            , ILiveVideoService liveVideoService
            , IMemberInfoService memberInfoService
            , ISalesSheetService salesSheetService)
		{
            _storageService = storageService;
            _liveVideoService = liveVideoService;
            _salesSheetService = salesSheetService;
            _memberInfoService = memberInfoService;

        }


		public void Execute(IJobExecutionContext context)
        {
            _storageService.SendBirthRemind();//生日提醒
            _storageService.SendMemberOrder();//预约到店提醒
            _liveVideoService.SetMemberIdForRelationship();//把直播关系链的openid与memberid关联
            _memberInfoService.DeleteWxInfo();//调度执行删除7天前被标记为已删除的微信信息
            _salesSheetService.DeleteSheet0(); //批量删除被标记为已删除的0表数据
            //_storageService.SendBirthRemindChat();//会话页面--生日提醒
            //_storageService.SendMemberOrderChat();//会话页面--邀约提醒
        }
    }
}

